package com.nineclock.common.exception;

import com.nineclock.common.enums.ResponseEnum;
import lombok.Data;

// 自定义异常实现
@Data
public class NCException extends RuntimeException {
    private Integer code;

    public NCException(ResponseEnum responseEnum){
        super(responseEnum.getMessage());
        this.code = responseEnum.getCode();
    }

    public NCException(ResponseEnum responseEnum, Throwable throwable){
        super(responseEnum.getMessage(), throwable);
        this.code = responseEnum.getCode();
    }
}
